import store from '@/store'
 //动态匹配按钮名称
function buttonName(dom) {

  // return new
  let a = []
  let b = []

  let nameList = store.state.user.permList
  nameList.forEach(item =>{
    a.push(item.moduleChildren)
  })
  a.forEach(item =>{
    item.forEach(itemA =>{
      b.push(itemA.moduleChildren)
    })
  })
  let arr = a.concat(b)
  let c = []
  arr.forEach(item =>{
    // console.log(item,'1111111')
    item.forEach(itemA =>{
      dom.filter((_item =>{
        if(_item === itemA.mdlCode){
            c.push(itemA.moduleChildrenGrand)
          }
          // console.log(c,'ccccccc')
      }))
    })
  })

  return c;
}

export default buttonName
